﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;
using CodingTheTweet;



namespace TwiXaml
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        bool check;
        
        
        
        public Window1()
        {
            
            InitializeComponent();
            
           
        }
        
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            
            if (textBox1.Text == "" && passwordBox1.Password == "")
            {
                MessageBox.Show("provide complete details");
            }
            else
            {   
               Twitter twitter = new Twitter();
               check = twitter.Login(textBox1.Text,passwordBox1.Password);

               if (check == true)
               {
                   TweetWin twin = new TweetWin(textBox1.Text, passwordBox1.Password);
                   twin.Show();
                   this.Hide();

               }
               else

                   MessageBox.Show("d");
            }
           
            
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            //Settings1.Default.pin = String.Empty;
            if (ConfigurationClass.Conf_check() == false)
            {            
                Configure conf = new Configure();
                conf.Show();
            }
        }

        
    }
}
